/*
 * ncurses_drawer.h
 *
 *  Created on: 2011-5-23
 *      Author: chenl
 */

#ifndef NCURSES_DRAWER_H_
#define NCURSES_DRAWER_H_

#include "drawer.h"
#include "monitor.h"
#include "task_wrapper.h"


class CNcursesDrawer : public IDrawer
{
public:
	CNcursesDrawer();
	virtual ~CNcursesDrawer();

	virtual int32_t Initialize();
	virtual int32_t Uninitialize();

	virtual void Update(void *);

protected:
	static void FormatPCBInfoString(char* szContent, const char* szColumnName, int& offset);
	static void _GetPCBInfoString_O_N(const CTask& task, char* szContent, unsigned& len);
	static void _GetPCBInfoString_O_1(const CTask& task, char* szContent, unsigned& len);

private:
	int 		columns_;
	int			rows_;
	CMonitor*	pRunQueueMointor_;
	CMonitor* 	pWaitQueueMointor_;
	void		(*getPCBInfoString_)(const CTask& task, char* szContent, unsigned& len);
};

#endif /* NCURSES_DRAWER_H_ */
